﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Sgr.DataCategories.Services
{
    /// <summary>
    /// 数据字典管理接口
    /// </summary>
    public interface ICategoryItemsManagement
    {
        /// <summary>
        /// 异步刷新指定类别的数据字典缓存
        /// </summary>
        /// <param name="category">数据字典类别</param>
        /// <param name="cancellationToken">取消令牌</param>
        Task RefreshCategoryAsync(string category, CancellationToken cancellationToken = default);

        /// <summary>
        /// 异步刷新所有数据字典缓存
        /// </summary>
        /// <param name="cancellationToken">取消令牌</param>
        Task RefreshAllAsync(CancellationToken cancellationToken = default);

        /// <summary>
        /// 异步预加载所有数据字典项
        /// </summary>
        /// <param name="cancellationToken">取消令牌</param>
        Task PreloadAllAsync(CancellationToken cancellationToken = default);
    }
}